﻿using MongoDB.Bson;

namespace MongoCamp
{
    /// <summary>
    /// The collection unique value
    /// </summary>
    public static class PrimaryKey
    {
        /// <summary>
        /// The collection unique value field name(_id)
        /// </summary>
        public const string Field = "_id";

        /// <summary>
        /// Generates a new ObjectId 
        /// </summary>
        /// <returns>ObjectId</returns>
        public static ObjectId GenerateNewId()
        {
            return ObjectId.GenerateNewId();
        }

        /// <summary>
        /// Generates a new guid string (Guid format is N)
        /// </summary>
        /// <returns>string</returns>
        public static string GenerateNewGuid()
        {
            return System.Guid.NewGuid().ToString("N");
        }

    }
}
